// ==================================================================================================
// Copyright(C) 2018 FI Ltd. All rights reserved.
//
// SYSTEM NAME	  : FI.Net Application Framework
// COMPONENT ID	  : FI.Server.DataAccess.DataUpatingEventArgs
// COMPONENT DESC :		
//
// CREATED DATE/BY:		18 Aug 2018 / Tian Mi
//
// REVISION HISTORY:	DATE/BY			SR#/CS/PM#/OTHERS		DESCRIPTION OF CHANGE
// ==================================================================================================

using System;
using System.Data;
using System.Diagnostics.CodeAnalysis;

namespace FI.Helpers.Data
{
    /// <summary>
    /// Provides data before the Data update events of control. 
    /// </summary>
    public sealed class DataUpdatingEventArgs : EventArgs
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DataUpdatingEventArgs"/> class.
        /// </summary>
        /// <param name="dbOperationType">Type of the database operation.</param>
        /// <param name="dataRows">The data rows.</param>
        public DataUpdatingEventArgs(DbOperationType dbOperationType, DataRow[] dataRows)
        {
            DbOperationType = dbOperationType;
            DataRows = dataRows;
        }

        /// <summary>
        /// Gets the database operation type.
        /// </summary>
        /// <value>The type of the database operation.</value>
        public DbOperationType DbOperationType { get; private set; }

        /// <summary>
        /// Gets data rows which will insert/update/delete.
        /// </summary>
        /// <value>The data rows.</value>
        public DataRow[] DataRows { get; private set; }
    }
}